<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/plugins/layui/css/layui.css}">
</head>
<body>
<div class="layui-form" th:object="${user}">
    <input type="hidden" th:field="*{id}">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" th:field="*{name}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" th:field="*{pass}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">出生日期</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="birthday" th:field="*{birthday}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">部门</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="deptId" id="deptId" th:with="depts=${@deptService.getDeptList()}">
                    <option>请选择</option>
                    <option th:each="d:${depts}" th:text="${d.deptName}" th:value="${d.deptId}"
                            th:selected="${user.dept != null && d.deptId == user.dept.deptId}"></option>
                </select>
            </div>
        </div>
    </div>

</div>
<script th:src="@{/js/plugins/layui/layui.js}"></script>
<script th:src="@{/js/jquery.min.js}"></script>
<script>
    layui.use(function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#birthday'
            , type: 'date'
        });
    })
</script>
</body>
</html>